<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<jsp:include page="changePwd.jsp" flush="true"/>
<link rel="stylesheet" href="<%=path%>/css/glsmcx.css" type="text/css" />
<script type="text/javascript" src="<%=path%>/js/controllers/ddglCtrl.js" ></script>
<script type="text/javascript" src="<%=path%>/js/libs/jquery.table2excel.js"></script>
<script type="text/javascript">
	var ctx="<%=path%>";   
	$("#generate-excel").click(function(){
	    $("#excTable").table2excel({ 
	        // 不被导出的表格行列的CSS class类 如果某列不需要在导出的文件中显示：<td class='.noExl'><td>
	        exclude: ".noExl", 
	        // 导出的Excel文件的名称
	        filename: "订单数据.xls"

	    });
	});
</script>
<input type="hidden" id="isInterior" value="${_user_supplier.isInterior}" />
<div class="glsmcxWrap">
	<div class="container-fluid">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">订单管理</h3>
			</div>
			<div class="panel-body clearfix">
				<form method="post" action="#" class="form-horizontal" role="form">

					<div class="form-group">
					 
					 	<div class="col-lg-31 clearfix"> 
					 		<label class="control-label labelPart">是否受理：</label>
							<div class="colPart">
								<select id="acceptorder-query"> 
									<option value="">全部订单</option>
									<option value="1">未受理订单</option>
									<option value="2">已受理订单</option> 
								</select>
							</div>
						</div> 
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">订单号：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control" name="orderid-query" placeholder="输入订单号">
							</div>
						</div>
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">订单状态：</label>
							<div class="colPart">
								<select name="state-query"> 
									<option value="">全部</option>
									<option value="1">未付款</option>
									<option value="2">已付款</option>
									<option value="3">报关中</option>
									<option value="4">已发货</option>
									<option value="5">已完成</option>
									<option value="6">已取消</option>
									<option value="7">报关失败</option>
									<option value="8">售后中</option>
									<option value="9">售后完成</option> 
								</select>
							</div>
						</div> 
						
						
						
						<div class="col-lg-34 more clearfix">
							<div class="morePart"><span>更多筛选</span>&nbsp;</div>														
							<button type="button" class="searchBtn">搜索</button>
							<button type="button" class="clearBtn">清空</button>							
						</div>
					</div> 

					<div class="form-group distant">
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">异常状态：</label>
							<div class="colPart">
								<select name="abnormalStatus-query">
								<!-- 客户订单状态：分为：1、已下单；2、已取消；3、已接单；4、已拒收；5、提货中；
								 6、已收货；7、已变更；8；已同意；9、待付款；10、已付款；11、已转单； -->
									<option value="">全部</option>
									<option value="1">正常</option>
									<option value="2">异常</option> 
								</select>
							</div>
						</div> 
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">贸易类型：</label>
							<div class="colPart">
								<select name="tradeType-query">
								<!-- 贸易类型，1保税直供，2国内发货，3海外直邮，4海外交货 -->
									<option value="">全部</option>
									<option value="1">保税直供</option>
									<option value="2">国内发货</option>
									<option value="3">海外直邮</option>
									<option value="4">海外交货</option> 
								</select>
							</div>
						</div> 
						 
						 <div class="col-lg-31 clearfix">
							<label class="control-label labelPart">快递单号：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control"
									name="logisticsNumber-query" placeholder="快递单号">
							</div>
						</div>
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">身份证号：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control"
									name="receiverIdnumber-query" placeholder="身份证号">
							</div>
						</div>
						
						<div class="col-lg-31 clearfix">
							<label class="control-label labelPart">收货人：</label>
							<div class="colPart">
								<input type="text" class="input-sm form-control"
									name="receiver-query" placeholder="收货人姓名">
							</div>
						</div> 
					
						<div class="col-lg-52 time clearfix">
							<label class="control-label labelPart">下单时间：</label>
							<div class="input-daterange input-group">
								<input type="text" class="input input-sm form-control"
									id="date-start" placeholder="起始时间" readonly="readonly" /> <span
									class="input-group-addon">至</span> <input type="text"
									class="input input-sm form-control" id="date-end"
									placeholder="结束时间" readonly="readonly" />
							</div>
						</div>
						
					</div> 
					<ul class="clearfix listwork">
						<li class="add clearfix" id="acceptMany"><i></i>受理订单</li>
						<li class="print clearfix" id="generate-excel"><i></i>导出</li>
					</ul>
					<div class="table-responsive">
						<table class="table table-bordered gltable check left" id="excTable">
							<thead>
								<tr>
									<th> 
										<div class="checkbox">
									    	<label><input type="checkbox" class="all" /></label>
									    </div>
								    </th>
								    <th>序号</th>
								    <th>订单号</th>
								    <th>收货人</th>
								    <th>收货人电话</th> 
								    <c:if test="${_user_supplier.isInterior == '1'}">
										<th>订单金额</th>
									</c:if> 
									<th>贸易类型</th>
									<th>订单状态</th> 
									<th>支付方式</th>
									<th>是否异常</th>
									<th>下单时间</th>
									<th class="noExl">操作</th>
								</tr>
							</thead>

							<tbody id="dataBody">
								 
							</tbody>
						</table>
						
						<table class="table2excel table table-bordered hide"> 
							 
						</table>
					</div>
				</form>
			</div>
		</div>
		<div class="clearfix pageBottom">
	
		<div class="record-wrapper page" role="status" aria-live="polite">
			当前<span class="pageNo"> </span>/<span class="totalPages"> </span>页，每页
			<label class="inline">
				<select name="dataTable_length" 
					class="form-control input-sm setTableLength" aria-controls="dataTable">
					<option selected="selected" value="10">10</option>
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
					<option value="300">300</option>
					<option value="400">400</option>
					<option value="500">500</option>
					<option value="1000">1000</option>
			</select> 
			</label>&nbsp;条记录,共<span class="record-wrapper totalCount">0</span>条记录
		</div>
	

	<nav>
		<!-- 这里显示分页 -->
		<div id="Pagination" class="pagination"></div>
	</nav>
</div>
	</div>
</div>

<!-- 订单详情Modal -->
<div class="modal fade modal-edityd" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true" >
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">订单详情</h4>
			</div>
			<form class="form-horizontal" novalidate="novalidate" id="orderDetailForm">
				<div class="modal-body"> 
					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label" id="orderid-label">订单号：</label>
							<div class="col-sm-81">
								<input type="hidden" class="form-control input-sm" name="id">
								<input type="text" readonly="readonly" class="form-control input-sm" placeholder="" name="orderId">
							</div>
						</div>

						<div class="col-lg-31">
							<label class="col-sm-41 control-label">贸易类型：</label>
							<!-- 贸易类型，1保税直供，2国内发货，3海外直邮，4海外交货，待确认 -->
							<div class="col-sm-81"> 
								<select disabled="disabled" name="tradeType" value="" class="form-control">
									<option value="1">保税直供</option>
									<option value="2">国内发货</option>
									<option value="3">海外直邮</option>
									<option value="4">海外交货</option>
								</select> 
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">订单状态：</label>
							<div class="col-sm-81 dropdown"> 
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="status"> 
								<!-- <select disabled="disabled" name="status" value="" class="form-control">
									<option value="1"> </option>

								</select> -->
							</div>
						</div>  
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">下单时间：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="createTime"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">支付时间：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="paymentTime"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">支付方式：</label>
							<div class="col-sm-81 dropdown">  
							<!-- 支付方式，1微信，2支付宝，3刷卡，4线下支付 -->
								<select disabled="disabled" name="paymentType" value="" class="form-control">
									<option value="1">微信</option>
									<option value="2">支付宝</option>
									<option value="3">刷卡 </option>
									<option value="4">线下支付</option>
									<option value="5">系统预付款</option>
								</select>
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">收货人：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="receiver"> 
							</div>
						</div>
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">手机号：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm  current-time" readonly name="receiverMobile"> 
							</div>
						</div>
					</div>

					<div class="form-group">
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">身份证号：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" placeholder="0.00" name="receiverIdnumber">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">收货地址：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="receiverPcdt" >
							</div>
						</div>
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">物流公司：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" name="logisticsName">
							</div>
						</div> 
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">物流单号：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm" placeholder="物流单号" name="logisticsNumber">
							</div>
						</div>
					</div> 

					<div class="form-group">
						
						<div class="col-lg-31">
							<label class="col-sm-41 control-label">发货时间：</label>
							<div class="col-sm-81">
								<input type="text" readonly="readonly" class="form-control input-sm " placeholder="发货时间" name="deliveryTime"> 
							</div>
						</div> 
						
						<div class="col-lg-31" id="sendaddr1">
							<label class="col-sm-41 control-label">商家备注：&nbsp;</label>
							<div class="input-group col-sm-81"> 
								<input type="text" class="input-sm form-control" name="merchantRemark" placeholder="商家备注" readonly="readonly">
							</div>
						</div> 
					</div>

					<div class="form-group">  
						<div class="col-lg-61" id="receiveraddr1">
							<label class="col-sm-41 control-label ">订单留言：&nbsp;</label>
							<div class="col-sm-161">
								<div class="colPart6 dropdown">	
									<input type="text" class="input-sm form-control" placeholder="订单留言" name="orderRemark" readonly="readonly">	 
								</div> 
							</div>	 
						</div> 
						
						 
					</div> 

					<div class="form-group"> 
						<div class="col-lg-122" id="receiveraddr1" style="text-align: center">
							<table class="table" style="margin: auto">
								<thead >
									<tr> 
									    <th style="text-align: center;">商品货号</th>
									    <th style="text-align: center;">商品名称</th>
									    <th style="text-align: center;">效期</th>
									    <th style="text-align: center;">数量</th> 
										<th style="text-align: center;">规格</th>
										<th style="text-align: center;">供货价</th>
										<th style="text-align: center;">供货价小计</th>  
									</tr>
								</thead>
	
								<tbody id="orderDetailDataBody">
									 
								</tbody>
							</table>
						</div>
					</div> 
			</div> 
			</form>
			<div class="modal-footer  clearfix">
				<span class="red error1 hide"><i></i>信息提交错误</span> 
				
				<c:if test="${_user_supplier.isInterior == '1'}">
					<button type="button" data-toggle='modal' data-target='.modal-aftersale-detail' class="btn btn-primary" id="applyAftersaleButton">申请售后</button>
				</c:if>
				
				<button type="button" data-toggle='modal' data-target='.modal-sup-detail' class="btn btn-primary" id="applyAbnormalButton">申请异常</button>
				
				<button type="button" data-toggle='modal' data-target='.modal-delivery' class="btn btn-primary" id="deliveryButton">发货</button>
				
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> 
				
			</div>
		</div>
	</div>
</div>
<!-- 订单详情Modal -->

<!-- 申请售后s -->
<div class="modal fade modal-aftersale-detail modal-detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content"> 
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">订单申请售后</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" novalidate="novalidate" id="applyAfterSaleForm">
				<input type="hidden" name="orderId" />
				<div class="form-group">
					<div class="col-lg-61">
						<label class="col-sm-41 control-label">售后原因：</label>
						<div class="col-sm-81">
						<!-- 售后原因，1错发/漏发，2拒签退回，3丢件，4瘪罐，99其他 -->
							<select name="causeType" value="" class="form-control">
									<option value="1">错发/漏发</option>
									<option value="2">拒签退回</option>
									<option value="3">丢件</option>
									<option value="4">瘪罐</option>
									<option value="99">其他</option> 
								</select> 
						</div>
					</div> 
				</div>   
				<div class="form-group clearfix">
						<div class="col-lg-161">
							<label class="col-sm-81 control-label">上传相关证明图：</label>
							<div class="col-sm-127">
								<input type="file" change="imgupload()" class="aftersaleImgUpload" accept="image/jpg,image/jpeg,image/png,image/bmp"/>
								<img style="width:300px" id="aftersaleImgShow" alt="" src=""> 
							</div>
							<input type="hidden" name="proImg"  />
						</div>
					</div>
				
				<div class="form-group">
					<div class="col-sm-161">
						<label class="col-sm-41 control-label">备注信息：</label>
						<div class="colPart6 dropdown">	
							<input type="text"  style="height:40px" name="remark" class="input-sm form-control" placeholder="请输入备注信息">	 
						</div> 
					</div>
				</div> 
			</form> 
			</div>
			<div class="modal-footer"> 
				<button type="button" class="btn btn-primary" id="btn-add-aftersale">保存</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>	 
		</div>	 
	</div>
			
</div>
<!-- 申请售后e -->

<!-- 申请异常s -->
<div class="modal fade modal-sup-detail modal-detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content"> 
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">订单申请异常</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" novalidate="novalidate" id="applyAbnormalForm">
				<input type="hidden" name="orderId" />
				<div class="form-group">
					<div class="col-lg-61">
						<label class="col-sm-41 control-label">异常原因：</label>
						<div class="col-sm-81">
							<select name="exceptionType" value="" class="form-control">
									<option value="1">海关清关不通过</option>
									<option value="2">缺货</option>
									<option value="3">海关人工审单</option>
									<option value="4">海外抽检验货</option>
									<option value="3">系统异常</option>
									<option value="4">其他</option>
								</select> 
						</div>
					</div> 
				</div>   
				<div class="form-group clearfix">
						<div class="col-lg-161">
							<label class="col-sm-81 control-label">上传异常证明图：</label>
							<div class="col-sm-127">
								<input type="file" change="imgupload()" class="abnormalImgUpload" accept="image/jpg,image/jpeg,image/png,image/bmp"/>
								<img style="width:300px" id="abnormalImgShow" alt="" src=""> 
							</div>
							<input type="hidden" name="imgPath"  />
						</div>
					</div>
				
				<div class="form-group">
					<div class="col-sm-161">
						<label class="col-sm-41 control-label">备注信息：</label>
						<div class="colPart6 dropdown">	
							<input type="text"  style="height:40px" name="remark" class="input-sm form-control" placeholder="请输入备注信息">	 
						</div> 
					</div>
				</div> 
			</form> 
			</div>
			<div class="modal-footer"> 
				<button type="button" class="btn btn-primary" id="btn-add-applyAbnormal">保存</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>	 
		</div>	 
	</div>
			
</div>
<!-- 申请异常e -->


<!-- 发货s -->
<div class="modal fade modal-add modal-delivery" tabindex="-1" role="dialog"
	aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
				</button>
				<h4 id="myModalLabel">用户</h4>
			</div>
			<div class="modal-body">
				<form class="form-horizontal" novalidate="novalidate" id="deliveryForm">

					<div class="form-group">
						<input type="hidden" name="id" />
						<div class="col-lg-61">
							<label class="col-sm-41 control-label">快递公司：</label>
							<div class="col-sm-81">
								<select name="logisticsId" >

								</select>
							</div>
						</div>

						<div class="col-lg-61">
							<label class="col-sm-41 control-label">快递单号：</label>
							<div class="col-sm-81">
								<input type="text" name="logisticsNumber" class="form-control input-sm"
									placeholder="快递单号">
							</div>
						</div>

					</div> 
					
				</form>
			</div>
			<div class="modal-footer">
				<span  class="errorMsg red"></span>
				<button type="button" class="btn btn-primary" id="btn-delivery-sub">保存</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button> 
			</div>
		</div>
	</div>
</div>
<!-- 发货e -->